<?php use_helper('I18N') ?>
<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>

<script type="text/javascript" src="/sf/js/calendar/calendar.js"></script>
<script type="text/javascript" src="/sf/js/calendar/lang/calendar-en.js"></script>
<script type="text/javascript" src="/sf/js/calendar/calendar-setup.js"></script>

<?php echo include_http_metas() ?>
<?php echo include_metas() ?>
<?php echo include_title() ?>
<?php echo include_stylesheets() ?>
<?php echo include_javascripts() ?>

<link rel="shortcut icon" href="/favicon.ico" />

<META http-equiv=Page-Enter content=blendTrans(Duration=1.0)>
<META http-equiv=Page-Exit content=blendTrans(Duration=1.0)>



<style type="text/css">

body 
  {
	  background-color: #D4D0C8;
	  margin-left: 0px;
	  margin-top: 0px;
	  margin-right: 0px;
	  margin-bottom: 0px;
  }

#bg
  {
    background: #ffffff url(images/title_bg.png) no-repeat ;
  }
</style>

<link rel="stylesheet" type="text/css" media="screen" href="/images/CSS/design.css" />

<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

function formchecking(){
	
	var txtusername = document.frmlogin.username.value;
	var txtpassword = document.frmlogin.password.value;
	var error = document.frmlogin.wlerrormsg1.value;
	var isOK = 'Yes';
	
	if (txtusername.length <= 0) {
		isOK = 'No';
		alert(error);		
	} else {
		if (txtpassword.length <= 0) {
			isOK = 'No';
			alert(error);			
		}
	}
	
	if (isOK == 'Yes') {
		return true;
	} else {
		return false;
	}
}

	function initialSetup() {
	}

	function SenderidStatusWindow(mypage, myname, w, h, scroll) 
	{
		var lf = (screen.width - 480)/2;
		var tf = (screen.height - 350)/2;
		var sizeIt = "width=400,height=200,scrollbars=yes,resizable=no,top="+tf+",left="+lf;
		win = window.open(mypage,'mywindow',sizeIt);
		if (window.focus) 
		{
			win.focus();
		}
	}
	
	function usnotime()
    {
		var mydate=new Date();
		var year=mydate.getYear();
		if (year < 1000){
		year+=1900;}
		var day=mydate.getDay();
		var month=mydate.getMonth();
		var daym=mydate.getDate();
		if (daym<10){
		daym="0"+daym;}
		var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
		var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
			var ut=new Date();
			var h,m,s,y,d,M;
			var time="      ";
			y=ut.getFullYear();
			M=ut.getMonth();
			d=ut.getDate();
			h=ut.getHours();
			m=ut.getMinutes();
			s=ut.getSeconds();
			if(s<=9) s="0"+s;
			if(m<=9) m="0"+m;
			if(h<=9) h="0"+h;
			time+=h+":"+m+":"+s;
			divtime.innerHTML=dayarray[day]+"<br>"+montharray[month]+" "+daym+", "+year+"<br>"+time;
			tick=setTimeout("usnotime()",1000);    
    }
</script>
</head>


<body onload="MM_preloadImages('/images/sign_up_over.png','/images/content_01_03_over.jpg','/images/content_01_04_over.jpg','/images/content_01_05_over.jpg','/images/content_01_06_over.jpg','/images/content_01_07_over.jpg','/images/content_01_08_over.jpg')">
<?php //include("language.php") 
	/*var_dump("customer_id->".$_SESSION['customer_id']);
    var_dump("superuser->".$_SESSION['superuser']);
    var_dump("customer_name->".$_SESSION['customer_name']);
	var_dump("customer_username->".$_SESSION['customer_username']);
	var_dump("signupsuccess->".$_SESSION['signupsuccess']);
	var_dump("MODULE->".$_SESSION['MODULE']);*/

?>
<?php if (!$sf_user->isAuthenticated() && !$_SESSION['url']=="Sign Up"): ?>
 <table width="620" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td scope="row">&nbsp;</td>
  </tr>
  <tr>
    <td scope="row"><table width="620" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="99" background="/images/top_bg_01.jpg" scope="row">&nbsp;</td>
      </tr>
      <tr>
        <td height="220" valign="top" background="/images/top_bg_02.jpg" scope="row">        		
        <table width="605" height="59%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td width="344" height="100%" align="left" scope="row">
            <table width="417" border="0" cellspacing="0" cellpadding="0">
<!--     #########################         -->
            	<?php echo form_tag('user/login', array('name' => 'frmlogin', 'onsubmit' => 'return formchecking()')) ?>
				<?php session_start(); ?>				
              <tr>
                <td width="56" scope="row">&nbsp;</td>
                <td colspan="2" class="MyTitle">Member Sign In </td>
                </tr>
              <tr>
                <td scope="row">&nbsp;</td>
                <td width="108" height="3">&nbsp;</td>
                <td width="266">&nbsp;</td>
              </tr>
              <tr>
                <td scope="row">&nbsp;</td>
                <td class="Myfont">User Name : </td>
                <td>
                  <?php echo input_tag('username') ?></td>
              </tr>
              <tr>
                <td scope="row">&nbsp;</td>
                <td class="Myfont">&nbsp;</td>
                <td height="1">&nbsp;</td>
              </tr>
              <tr>
                <td scope="row">&nbsp;</td>
                <td class="Myfont">Password : </td>
                <td><?php echo input_password_tag('password') ?></td>
              </tr>			
              <tr>
                <td scope="row">&nbsp;</td>
                <td>&nbsp;</td>
                <td><font color="#FFFFFF"><?php if ($_SESSION['login']){ ?><?php echo __($_SESSION['login']); ?><?php } ?></font>&nbsp;</td>
              </tr>
              <tr>
                <td scope="row">&nbsp;</td>
                <td colspan="2"><table width="325" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="210" scope="row"><div align="left" class="email"><a href="/customer/reset" class="email">Forget Password?</a> </div></td>
                      <td width="115"><div align="right">
                        <input name="Sign In" type="submit" id="login" value="<?php echo __('Sign In') ?>" />
                        <?php $_SESSION['login']=''; ?>
                      </div></td>
                    </tr>
                    </table></td>
                </tr>

            <input type='hidden' name="wlerrormsg1" value="<?php echo __('Please enter your username and password!') ?>" />
			</form>
<!--     #########################         -->
            </table>
            </td>
            <td width="276"><table width="186" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="9" rowspan="9" background="/images/bar.gif" scope="row">&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td rowspan="2" class="Myfont">&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td class="Myfont"><div align="center">
                <?php 				
				if ($_SESSION['signupsuccess']!=""){
					echo __($_SESSION['signupsuccess']);
					$_SESSION['signupsuccess']="";
				} else {
					echo "Are you New? <br /> Sign Up now to use our SMS Manager!";
        	  	} ?>
                	  </div></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><div align="center"><a href="/customer/edit" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('sign up','','/images/sign_up_over.png',1)"></a></div></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td><div align="center"><a href="/customer/edit" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','/images/sign_up_over.png',1)"><img src="/images/sign_up.png" name="Image1" width="108" height="27" border="0" id="Image1" /></a></div></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td width="9">&nbsp;</td>
                <td width="186">&nbsp;</td>
                <td width="10">&nbsp;</td>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="91" valign="top" background="/images/top_bg_03.jpg" scope="row"><table width="620" border="0" cellspacing="0" cellpadding="0">
          
          <tr>
            <td class="f_address" scope="row">&nbsp;</td>
          </tr>
          <tr>
            <td scope="row"><div align="center"><span class="design">MTL E-SOLUTIONS SDN BHD<br />
              </span><span class="f_address">SUITE 1525, LOBBY 7, BLOCK A, DAMANSARA INTAN NO 1, JLN SS20/27, 47400 PETALING JAYA. <br />
              Tel : 603-7710-6036 Fax : 603-7710-8632</span><br />
              <span class="f_address">E-mail:</span> <a href="mailto:askus@esol.com.my" class="email">askus@esol.com.my</a> <span class="f_address">Website:</span> <a href="http://www.esol.com.my" class="email">www.esol.com.my</a></div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
<!--</body>-->







<?php else: ?>



<!--====================================================================================================-->
<table width="790" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="790" height="125" scope="row"><table width="790" border="0" cellspacing="0" cellpadding="0">
    <tr>
        <td height="85" colspan="9" background="/images/top_button_01.jpg"></td>
      </tr>
      <tr>
        <td width="180" height="29"><img src="/images/top_button_02.jpg" width="180" height="29" /></td>
        <td width="22" background="/images/top_button_03.jpg">&nbsp;</td>
        <?php if (!$sf_user->isAuthenticated()){ ?>
        <td width="568" background="/images/top_button_03.jpg">&nbsp;</td>
        <?php } else { ?>
        <?php if ($_SESSION['superuser']!=1){ ?>
        <td width="111" background="/images/top_button_03.jpg">&nbsp;</td>        
        <?php } ?> 
        
        <td width="98" background="/images/top_button_03.jpg"><a href="/display/sendSms" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','/images/top_button_04_over.jpg',1)"><img src="/images/top_button_04.jpg" name="Image3" width="107" height="29" border="0" id="Image3" /></a></td>
        <td width="99" background="/images/top_button_03.jpg"><a href="/display/phoneBook" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','/images/top_button_05_over.jpg',1)"><img src="/images/top_button_05.jpg" name="Image4" width="99" height="29" border="0" id="Image4" /></a></td>                
        <td width="99" background="/images/top_button_03.jpg"><a href="/display/myAccount" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','/images/top_button_06_over.jpg',1)"><img src="/images/top_button_06.jpg" name="Image5" width="99" height="29" border="0" id="Image5" /></a></td>
                
        <?php if ($_SESSION['superuser']==1){ ?>
        <td width="111" background="/images/top_button_03.jpg"><a href="/display/admin" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image6','','/images/top_button_07_over.jpg',1)"><img src="/images/top_button_07.jpg" name="Image6" width="111" height="29" border="0" id="Image6" /></a></td>        
        <?php } ?> 
        
        <td width="76" background="/images/top_button_03.jpg"><a href="/display/faq" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image7','','/images/top_button_08_over.jpg',1)"><img src="/images/top_button_08.jpg" name="Image7" width="76" height="29" border="0" id="Image7" /></a></td>
        <td width="72" background="/images/top_button_03.jpg"><a href="/user/logout" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image8','','/images/top_button_09_over.jpg',1)"><img src="/images/top_button_09.jpg" name="Image8" width="78" height="29" border="0" id="Image8" /></a></td>
        <?php } ?>
        <td width="18"><img src="/images/top_button_10.jpg" width="18" height="29" /></td>
      </tr>                  
      <tr>
        <td height="11" colspan="9" background="/images/top_button_11.jpg"></td>
      </tr>                       
  </table></td>
  </tr>
  <tr>
    <td scope="row"><table width="790" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="140" align="left" valign="top" background="/images/content_02.jpg" scope="row"><table>
          <tbody>
            <tr>
              <td colspan="2" valign="middle"><div align="center" class="sitemenu_txt">Welcome <?php echo $_SESSION['customer_name'] ?> <span class="welcome_txt"><br/>                        
                    <div class="welcome_txt" id="divtime"><?php echo date('D Y-m-d', time()) ?></div>            
                  </span></div></td>
            </tr>
            <tr valign="top">
              <td colspan="2">&nbsp;</td>
            </tr>
            <?php if($_SESSION['MODULE']=='SENDSMS'){  ?>          	            
            <tr>
              <td class="style1">&nbsp;</td>
              <td width="105" valign="bottom" class="sitemenu_txt">SEND SMS</td>
            </tr>
            <tr>
              <td width="8">&nbsp;</td>
              <td class="sitemenu_txt"><a href="/sendsms" class="btn_txt">- Compose</a></td>
            </tr>
            <tr>
              <td width="8">&nbsp;</td>
              <td class="btn_txt"><a href="/msgtemplate/show" class="btn_txt">- Message Template</a></td>
            </tr>            
            <!--<tr>
              <td>&nbsp;</td>
              <td class="btn_txt"><a href="/inbox" class="btn_txt">- Inbox</a></td>
            </tr>-->  
            <tr>
              <td>&nbsp;</td>
              <td class="btn_txt"><a href="/outbox" class="btn_txt">- Outbox</a></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="btn_txt"><a href="/outbox/trash" class="btn_txt">- Trash</a></td>
            </tr>
            <tr>
              <td colspan="2">&nbsp;</td>
            </tr>
            <?php } ?>
            <?php if($_SESSION['MODULE']=='PHONEBOOK'){  ?>
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style1">PHONE BOOK </span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="btn_txt"><a href="/contact/list" class="btn_txt">- Individual Contacts</a><a href="http://localhost/contact/list" class="linkcolor"> </a></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="btn_txt"><span class="style10"><a href="/contactgroup/list" class="btn_txt">- Contact Groups </a></span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="btn_txt"><span class="style10"><a href="/import" class="btn_txt">- Import Contacts</a> </span></td>
            </tr>            
            <tr>
              <td>&nbsp;</td>
              <td class="btn_txt"><p class="style10"><span class="btn_txt"><a href="/blockedlist" class="btn_txt">- Mobile Blocked<br />
  &nbsp; List</a></span></p>
                </td>
            </tr>
            <tr>
              <td colspan="2">&nbsp;</td>
            </tr>
            <?php } ?>
            <?php if($_SESSION['MODULE']=='MYACCOUNT'){  ?>
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style1">MY ACCOUNT </span></td>
            </tr>            
            <tr>
              <td>&nbsp;</td>
              <td class="btn_txt"><span class="style10"><a href="/customer/edit?id=<?php echo $_SESSION['customer_id']; ?>" class="btn_txt">- My Profile </a></span></td>
            </tr>
            <tr>
			  <td>&nbsp;</td>
			  <td class="btn_txt"><span class="style10"><a title='Request sender id(s)'  class="btn_txt" HREF="javascript:SenderidStatusWindow('/senderid/request')">- <?php echo __('Request Sender ID') ?> </a></span></td>
			</tr>
            <tr>
              <td>&nbsp;</td>
              <td class="btn_txt"><span class="style10"><a href="/topup/step" class="btn_txt">- How To Top-up</a> </span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="btn_txt"><span class="style10"><a href="/report" class="btn_txt">- Report</a> </span></td>
            </tr>                                    
            <tr>
              <td colspan="2">&nbsp;</td>
            </tr>
            <?php } ?>
            <?php if($_SESSION['MODULE']=='ADMIN'){  ?>
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style1">ADMINISTRATION </span></td>
            </tr>
            <!--<tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style10"><a href="/user/userAccess" class="btn_txt">- User Access &nbsp; &nbsp;</a></span></td>
            </tr>-->
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style10"><a href="/customer/list" class="btn_txt">- Customer Profiles &nbsp; &nbsp;<?php echo $_SESSION['newcustomer'];?></a></span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style10"><a href="/senderid/list" class="btn_txt">- Manage Sender ID &nbsp; &nbsp;<?php echo $_SESSION['newsenderid'];?></a></span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style10"><a href="/topup" class="btn_txt">- Top-up For &nbsp;Customer</a> </span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style10"><a href="/package" class="btn_txt">- Packages</a> </span></td>
            </tr>            
			 <!--<tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style10"><a href="/package/ptlist" class="btn_txt">- Checkout Packages</a> </span></td>
            </tr>-->                          		   
           <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style10"><a href="/report/balance" class="btn_txt">- Check Balance</a> </span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style10"><a href="/report/usage" class="btn_txt">- Customer Usage &nbsp;Report</a> </span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style10"><a href="/report/monthactivity" class="btn_txt">- Monthly Activity <br />
                &nbsp;Report</a> </span></td>
            </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style10"><a href="/report/statistic" class="btn_txt">- Usage Statistic <br />
                &nbsp;Report</a> </span></td>
            </tr>                                                                                            
            <tr>
              <td height="2" colspan="2">&nbsp;</td>
            </tr>
            <?php } ?>            
            <!--<tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style1"><a href="/faq/list" class="sitemenu_txt">FAQ</a></span></td>
            </tr>
            <tr> </tr>
            <tr>
              <td>&nbsp;</td>
              <td class="sitemenu_txt"><span class="style1"><a href="/user/logout" class="sitemenu_txt">LOG OUT</a></span></td>
            </tr>-->
            <!--<tr>
        <td>&nbsp;</td>
        <td><span class="style1"><a href="/faq/changecolor" class="linkcolor">Change Color</a></span></td>
      </tr>-->
            <tr valign="middle">
              <td colspan="2"><br /></td>
            </tr>
          </tbody>
        </table></td>
        <td width="623" align="left" valign="top" bgcolor="#FFFFFF">
        
        
<!-- ##############################  AFTER LOGIN  #####################################################################        -->
        
         
        <table width="547" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="25" scope="row"><div align="center">
            	<span class="content_body_text">
            		<strong>
            		<?php if ($_SESSION['superuser']=="1" && $_SESSION['alert'] != "!") { 
		            			echo $_SESSION['alert']; } 
		        			else { 
		        				echo __(''); } ?>
    				</strong>
            	</span>
            	<span class="style16"><strong>
            	<!--</marquee>-->
            	</strong></span></div>
          	</td>
          </tr>
          <tr>
  			<td scope="row"><?php echo $content; ?></td>
  		  </tr>
        </table>          
        <p>&nbsp;</p>
          </td>
        <td width="27" background="/images/content_06.jpg">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td width="790" height="90" background="/images/content_08.jpg" scope="row"><table width="605" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td class="f_address" scope="row">MTL E-SOLUTIONS SDN BHD, ALL RIGHTS RESERVED 2008</td>
      </tr>
    </table></td>
  </tr>
</table>

</body>
</html>
<?php endif; ?>
<?php $_SESSION['url']=""; ?>